import request from '@/utils/request'

/**
 * 获取购物车商品
 * @returns
 */
export function getShopCarList() {
  return request({
    url: '/api/shopcar/getShopCarList',
  })
}

/**
 * 删除购物车
 * @returns
 */
export function deleteShopCar(params, token) {
  return request({
    url: '/api/shopcar/deleteShopCar',
    headers: {
      token,
    },
    params,
  })
}

/**
 * 加入购物车
 * @returns
 */
export function addShopCar(data, token) {
  return request({
    url: '/api/shopcar/addShopCar',
    method: 'post',
    headers: {
      token,
    },
    data,
  })
}

/**
 * 删除购物车 [批量]
 * @returns
 */
export function deleteShopCars(data, token) {
  return request({
    url: '/api/shopcar/deleteShopCars',
    method: 'post',
    headers: {
      token,
    },
    data,
  })
}
